
#include "log.h"

static char log[LOG_BUF_LEN]={0};

/*
 * provides some debug functions and apis
 */

// log the packet content 
int log_packet_content(const char *prefix,const char *buff, int len)
{
	if(prefix == NULL||buff == NULL || len <= 0)
	{
		dzlog_error("invalid params!");
		return -1;
	}

	int i, cnt = 0;

	dzlog_debug("%s:",prefix);
	for(i=0;i<len;i++)
	{
		cnt += snprintf(log+cnt,LOG_BUF_LEN-cnt, " 0x%02x ", buff[i]);
	}
	dzlog_debug("%s\n",log);

	return 0;
}

